//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Chart
{
    public abstract class MultiLevelStringReference : DataSource
    {
        public abstract string Formula { get; }

        internal static MultiLevelStringReference ReadMultiLevelStringReference(ReadContext context)
        {
            MultiLevelStringReference result =
                ReadContextData.GetReferenceFactory(context).CreateMultiLevelStringReference();
            result.ReadXmlCore(context);
            return result;
        }

        protected override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("multiLvlStrRef"))
            {
                c.WriteElementString("f", Formula);
                //\\c.WriteOptionalElement(strCache);
                c.WriteOptionalElement(Extension);
            }
        }

        /*private ExtensionElement _extLst;

        public ExtensionElement Extension
        {
            get { return _extLst; }
            set { _extLst = value; }
        }*/
    }
}